package org.sage.sdk.dada.order.entity;

import org.sage.sdk.dada.infrastructure.common.attributes.Callback;
import org.sage.sdk.dada.infrastructure.common.attributes.CityCode;
import org.sage.sdk.dada.infrastructure.common.attributes.IsPrepay;
import org.sage.sdk.dada.infrastructure.common.attributes.ShopNo;
import org.sage.sdk.dada.infrastructure.utils.GetBodyUtil;
import org.sage.sdk.dada.order.aggregate.Cargo;
import org.sage.sdk.dada.order.aggregate.Order;
import org.sage.sdk.dada.order.aggregate.Origin;
import org.sage.sdk.dada.order.aggregate.Receiver;

/**
 * 重新发布订单
 * <p>
 * 在调用新增订单后，订单被取消、过期或者投递异常的情况下，调用此接口，可以在达达平台重新发布订单。
 * <p>
 * 接口调用URL地址：/api/order/reAddOrder。
 *
 * @author 周广明
 * @version v1 2019/12/10 下午5:30
 */
public class ReAddOrder extends Order {

    @Override
    public String getUrl() {
        return "/api/order/reAddOrder";
    }

    @Override
    public String getBody() {
        return GetBodyUtil.toJsonStr(this);
    }

    public ReAddOrder(ShopNo shopNo, Origin origin, CityCode cityCode, Cargo cargo,
                      IsPrepay isPrepay, Receiver receiver, Callback callback) {
        super(shopNo, origin, cityCode, cargo, isPrepay, receiver, callback);
    }
}
